﻿@{
    Layout = "~/Views/Shared/_Layout.cshtml";
}
@model Domain.SYS_ROLE
<style type="text/css">.gray-bg {background-color: white;}</style>
@using (Ajax.BeginForm("Save", null, new AjaxOptions()
                           {
                               HttpMethod = "Post",
                               OnBegin = "SubAjax.Loading",
                               OnComplete = "SubAjax.Complate",
                               OnFailure = "SubAjax.Failure",
                               OnSuccess = "SubAjax.Success"
                           },
                               new { @class = "form-horizontal dig-from", @role = "form" }))
{
    @Html.HiddenFor(p => p.ID)
    @Html.HiddenFor(p => p.CREATEDATE)
    @Html.HiddenFor(p => p.CREATEPERID)
    <div class="wrapper wrapper-content animated fadeInUp">
        <div class="row">
            <div class="ibox-detail-title">
                <i class="fa fa-pencil-square-o"></i>添加/修改角色
            </div>
            <div class="ibox-content">
                <div class="form-group">
                    <label class="col-xs-2 control-label">所属系统：</label>
                    <div class="col-xs-10">
                        <select name="FK_BELONGSYSTEM" class="form-control input-sm  input-s inline">
                            @{
                                foreach (var item in ViewData["Systemlist"] as dynamic)
                                {
                                    <option value="@item.ID" @(Model.FK_BELONGSYSTEM == item.ID ? "selected=\"selected\"" : "")>@item.NAME</option>
                                }
                            }
                        </select>

                    </div>
                </div>
                <div class="hr-line-dashed"></div>
                <div class="row">
                    <div class="col-xs-6">
                        <div class="form-group">
                            <label class="col-xs-4 control-label">角色名称：</label>
                            <div class="col-xs-8">
                                @Html.TextBoxFor(p => p.ROLENAME, new { @class = "form-control", @placeholder = "请输入角色名称", @datatype = "*", @nullmsg = "请输入角色名称！", @errormsg = "请输入角色名称！" })
                            </div>
                        </div>
                    </div>
                    <div class="col-xs-6">
                        <div class="form-group">
                            <label class="col-xs-4 control-label">系统预置：</label>
                            <div class="col-xs-8">
                                <label class="jswitch_line">
                                    @Html.CheckBox("cbx-custom",Model.ISCUSTOM==1, new { @class = "js-switch" })
                                </label>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="hr-line-dashed"></div>
                <div class="form-group">
                    <label class="col-xs-2 control-label">备注：</label>
                    <div class="col-xs-10">
                        @Html.TextAreaFor(p => p.ROLEDESC, new { @class = "form-control", @row = "4", @placeholder = "备注" })
                    </div>
                </div>
                <div class="hr-line-dashed"></div>
                <div class="text-center">
                    <button class="btn btn-primary btn-save" type="submit"><i class="fa fa-check"></i> <span>确定保存</span></button>
                    <button class="btn btn-warning" id="btn-dig-close" type="button"><i class="fa fa-reply-all"></i> 取消返回</button>
                </div>
            </div>
        </div>
    </div>
}
@section scripts{
    <script type="text/javascript">
        $(function () {
            $('.form-horizontal').initValidform();
        });
    </script>
}
